using System;
using System.Collections.Generic;
using System.Text;
using System.Data.OleDb;
using System.Data;
using DTO;
namespace DAO
{
   public  class PhieuThuTienPhat
    {
       public List<PhieuThuTienPhatDTO > laydspttienphat_DAO()
       {
           List<PhieuThuTienPhatDTO > list = new List<PhieuThuTienPhatDTO >();
           string sql = "select * from PhieuThuTienPhat";
           DataTable dt = DataProvider.ExcuteQuery(sql);
           if (dt.Rows.Count > 0)
           {
               for (int i = 0; i < dt.Rows.Count; i++)
               {
                   DataRow dr = dt.Rows[i];

                   int maphieuthutienphat = int.Parse(dr["MaPhieuThuTienPhat"].ToString());
                   int madocgia = int.Parse(dr["MaDocGia"].ToString());
                   int tienno = int.Parse(dr["TienNo"].ToString());
                   int sotienthu = int.Parse(dr["SoTienThu"].ToString());
                   int nguoithu = int.Parse(dr["NguoiThu"].ToString());

                   PhieuThuTienPhatDTO pttp = new PhieuThuTienPhatDTO();
                   pttp.Maphieuthutienphat = maphieuthutienphat;
                   pttp.Madocgia = madocgia;
                   pttp.Tienno = tienno;
                   pttp.Sotienthu = sotienthu;
                   pttp.Nguoithu = nguoithu;
                   list.Add(pttp);
               }
           }
           return list;

       }
    }
}
